From: Keir Fraser Date: Mon, 21 Jun 2010 08:55:12 +0000 (+0100) Subject: libxc: Fix Segmentation fault of xend X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11903 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=ff4cc394909125814f2a1e2e8e592b105f5ffc44;p=xen.git libxc: Fix Segmentation fault of xend If /proc/xen/privcmd cannot be opened, start xend occurs Segmentation fault. Add check to fix it. Signed-off-by: Yu Zhiguo --- diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index 9761b98af4..13a990a58c 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -82,8 +82,10 @@ const xc_error *xc_get_last_error(xc_interface *xch) void xc_clear_last_error(xc_interface *xch) { - xch->last_error.code = XC_ERROR_NONE; - xch->last_error.message[0] = '\0'; + if (xch) { + xch->last_error.code = XC_ERROR_NONE; + xch->last_error.message[0] = '\0'; + } } const char *xc_error_code_to_desc(int code)